package wang.Generics;

import java.util.ArrayList;

public class Genericsdemo2 {
    public static void main(String[] args) {

        Genericsdemo1<String> listfangfa = new Genericsdemo1<>();

        listfangfa.add("sss");
        listfangfa.add("aaa");
        listfangfa.add("bbb");
        listfangfa.add("eee");

        System.out.println(listfangfa);

        Genericsdemo1<Integer> listfangfa1 = new Genericsdemo1<>();
        listfangfa1.add(111);
        listfangfa1.add(133);
        listfangfa1.add(123);

        System.out.println(listfangfa1.get(0));
        System.out.println(listfangfa1.size);
        System.out.println(listfangfa1);

        ArrayList<String> list1 = new ArrayList<>();
        Genericsdemo3.addall(list1, "aaa", "ddd", "ccc", "eee");
        System.out.println(list1);
        ArrayList<Integer> list2 = new ArrayList<>();
        Genericsdemo3.addall(list2, 2, 33, 4, 44);
        System.out.println(list2);

        Genericsdemo4 list = new Genericsdemo4();
        list.add("aaa");


        Genericsdemo5<Integer> list5 = new Genericsdemo5<>();
        list5.add(123);


    }
}
